package ntu.metaweb.result;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@XStreamAlias("page")
public class Page {
	protected String url;
	@XStreamAlias("url_param")
	protected String urlParameter;
	protected String title;
	@XStreamAlias("tagrating")
	protected int tagRating;
	@XStreamAlias("pagerating")
	protected double pageRating;
	
	public Page(ntu.metaweb.storage.Tag tag, String title, double pageRating) {
		String temp = tag.getURL().toExternalForm();
		this.url = temp;
		this.urlParameter = tag.getURL().getQuery();
		this.tagRating  = tag.getTotalRating();
		// TODO fix this
		this.pageRating = pageRating;
		this.title = title.length() == 0 ? temp : title;
	}
}
